// 对象类型
/**
let person = {
  name: 'zhangsan',
  age: 12,
  sex: true
}

let person2 = {
  name: 'wenqing',
  age: 20,
  sex: true
}
 */

// 抽取出来的对象类型
type Person = {
  name: string
  age: number
  //   sex?: boolean
  sex?: 0 | 1 | 2 // 字面量联合类型
}

let person1: Person = { name: '张文清', age: 25, sex: 2 }
let person2: Person = { name: '李奇', age: 28, sex: 0 }

type Point2D = {
  x: number
  y: number
}

type Point3D = Point2D & {
  z: number
}

const point: Point3D = {
  x: 200,
  y: 200,
  z: 200
}
